Page({
  data: {
staffid:''
  },
  onLoad() {
    var that=this;
dd.getStorage({
  key: 'staffid',
  success: function(res) 
  { 
    //console.log(res.data);
  that.setData({

   staffid:res.data

  });
  }
});

  },
  info:function(e){




   console.log(e.detail.value);
 
var aIsSelfCar  =e.detail.value.IsSelfCar;
var  adestination=e.detail.value.destination;
var  adtime=e.detail.value.dtime;
var amoblie=e.detail.value.moblie;
var aoriginal=e.detail.value.original;
var aremark=e.detail.value.remark;
var  ausersnumber=e.detail.value.usersnumber;


if(adtime.length!=12||isNaN(adtime)){
   
dd.showToast({

     content:"请填写正确的用车时间",

     });

     return ;
}
var that=this;
   dd.httpRequest({

        
          url:'http://ding.tida-lighting.com/api/leave/SendCar',
          dataType:'json',
          method:'POST',
          data:{
                IsSelfCar  :aIsSelfCar,
                destination:adestination,
                dtime:adtime,
                moblie:amoblie,
                original:aoriginal,
                remark:aremark,
                usersnumber:ausersnumber,
                empid:that.data.staffid,
         

          },
          success: function (res) {
          console.log(res);
      dd.showToast({
    title: '您好',
     content:res.data.msg,
     success: () => {
       dd.navigateBack({
delta:2 //返回上一级页面
});
      
  },

     });



          }, fail: (err) => {
           //dd.alert({content: JSON.stringify(err)})
           console.log(err);
        }
          
          });

  },
});
